package lab03.test05;

import java.io.*;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        System.out.println("输入一个字符串");
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();


        char[] chars = str.toCharArray();
        char[] chars1 = new char[str.length()];
        for (int i = 0; i < str.length(); i++) {
            chars1[i] = (char) ((int) chars[i] + 1);
            System.out.println(chars1[i]);
        }

        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter("E:\\test05.txt"));
            BufferedReader reader = new BufferedReader(new FileReader("E:\\test05.txt"));


            for (int i = 0; i < chars1.length; i++) {
                writer.write(chars1[i]);
            }

            int current;
            while ((current = reader.read()) != -1) {
                System.out.println((char) ((current) - 1));
            }

            writer.close();
            reader.close();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
